package com.java.utils;

/**
* @ClassName: SqlCons
* @Description: sql记录
* @author ChenJiaLu
* @date 2023年12月29日 下午2:54:40
*
 */
public interface SqlCons {

	public class LOGIN { 
		 public static final String ADMIN   = "select * from `admin`  where name = ? limit 1";
		 public static final String DOCTOR  = "select * from `doctor`  where number = ? limit 1";
		 public static final String PATIENT = "select * from `patient`  where number = ? limit 1";
	}
	
	public class ADMIN { 
		 public static final String UPDATE_PASSWORD   = "UPDATE `admin` SET password = ? WHERE  id = ? ";
	}
	
	public class DOCTOR { 
		 public static final String SELECT_ALL   = "select * from `doctor`";
		 public static final String INSERT   = "INSERT INTO `doctor` (`number`, `name`, `age`, `degree`, `sex`, `password` ) VALUES (?, ?, ?, ?, ?, ?);";
		 public static final String UPDATE   = "UPDATE `doctor` SET `number` = ?, `name` = ?, `age` = ?, `degree` = ?, `sex` = ?, `password` = ? WHERE `id` = ?;";
		 public static final String DELETE   = "DELETE FROM `doctor` WHERE `id` = ?;";
		 public static final String SELECT_INFO   = "SELECT * from `doctor` WHERE `id` = ?;";
	}
	
	public class PATIENT { 
		 public static final String SELECT_ALL   = "select * from `patient`";
		 public static final String INSERT   = "INSERT INTO `patient` (`number`, `name`, `age`, `disease`, `sex`, `password` ) VALUES (?, ?, ?, ?, ?, ?);";
		 public static final String UPDATE   = "UPDATE `patient` SET `number` = ?, `name` = ?, `age` = ?, `disease` = ?, `sex` = ?, `password` = ? WHERE `id` = ?;";
		 public static final String DELETE   = "DELETE FROM `patient` WHERE `id` = ?;";
		 public static final String SELECT_INFO   = "SELECT * FROM `patient` WHERE `id` = ?;";
	}
	
	public class ORDER { 
		 public static final String SELECT_ALL   = "select * from `order`";
		 public static final String SELECT_DOCTOR   = "select * from `order` where doctorid = ?";
		 public static final String SELECT_PATIENT   = "select * from `order` where patientid = ?";
		 public static final String INSERT   = "INSERT INTO `order` (`doctorid`, `patientid`, `timeslot` ) VALUES (?, ?, ?);";
		 public static final String UPDATE   = "UPDATE `order` SET `doctorid` = ?, `patientid` = ?, `timeslot` = ? WHERE `id` = ?;";
		 public static final String DELETE   = "DELETE FROM `order` WHERE `id` = ?;";
	}
	
	public class COMMENT { 
		 public static final String SELECT_ALL   = "select * from `comment`";
		 public static final String SELECT_DOCTOR   = "select * from `comment` where doctorid = ?";
		 public static final String SELECT_PATIENT   = "select * from `comment` where patientid = ?";
		 public static final String INSERT   = "INSERT INTO `comment` (`doctorid`, `patientid`, `content`, `reply` ) VALUES (?, ?, ?, ?);";
		 public static final String UPDATE   = "UPDATE `comment` SET `doctorid` = ?, `patientid` = ?, `content` = ?, `reply` = ? WHERE `id` = ?;";
		 public static final String DELETE   = "DELETE FROM `comment` WHERE `id` = ?;";
	}
	
	public class TIMESLOT { 
		 public static final String SELECT_ALL   = "select * from `timeslot`";
		 public static final String SELECT_DOCTOR   = "select * from `timeslot` where `doctorid` = ? limit 1";
		 public static final String INSERT   = "INSERT INTO `timeslot` (`doctorid`, `day1`, `day2`, `day3`, `day4`, `day5`, `day6`, `day7` ) VALUES (?, ?, ?, ?, ?, ?, ?, ?);";
		 public static final String UPDATE   = "UPDATE `timeslot` SET `doctorid` = ?, `day1` = ?, `day2` = ?, `day3` = ?, `day4` = ?, `day5` = ? , `day6` = ? , `day7` = ? WHERE `id` = ?;";
		 public static final String DELETE   = "DELETE FROM `timeslot` WHERE `id` = ?;";
	}
}
